package com.jrtc.backend.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jrtc.base.config.dto.ResultDTO;
import com.jrtc.base.config.dto.ResultDTOBuilder;
import com.jrtc.base.entity.bo.Department;
import com.jrtc.base.entity.vo.PatientDescriptionVo;
import com.jrtc.service.DepartmentService;
import com.jrtc.service.PatientRiskDescriptionService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("patientDescription")
public class PatientRiskDescriptionController {
    /**
     * 服务对象
     */
    @Resource
    private PatientRiskDescriptionService patientRiskDescriptionService;

    /**
     * 患者证件号获取疾病风险
     * */
    @PostMapping("/descriptionByIdCard")
    public ResultDTO descriptionByIdCard(@RequestBody Map<String, Object> map){
        String idCard = map.get("idCard").toString();

        List<PatientDescriptionVo> patientDescriptionVoList = patientRiskDescriptionService.descriptionByIdCard(idCard);
        return ResultDTOBuilder.success(patientDescriptionVoList);
    }
}